package com.huazi.user.registration.service.Imp;

import com.huazi.user.registration.dao.UpdateI;
import com.huazi.util.SessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.HashMap;
import java.util.Map;


public class UpdateService {


    public boolean updatePwd(String idCard, String account, String phone, String name, String pwd) {
        Map<String,Object> map=new HashMap<>();
        map.put("pwd",pwd);
        map.put("idCard",idCard);
        map.put("account",Integer.parseInt(account));
        map.put("phoneNumber",phone);
        map.put("name",name);

        SqlSession session = SessionUtil.getSession();
        UpdateI mapper = session.getMapper(UpdateI.class);
        Integer integer = mapper.updatePwd(map);
        session.commit();
        if(integer==1){
            return true;
        }
        return false;
    }
}
